package utils.utils.vo;


import java.io.Serializable;
import java.util.Arrays;

/**
 * 请求参数类
 */
public class InvokerVo implements Serializable {

    private static final long serialVersionUID = -2655439281867773413L;

    /**
     * 全限定名
     */
    private String beanName;

    private String methodName;

    /**
     * 参数类型全限定名
     */
    private String paramsTypes[];

    /**
     * 参数
     */
    private String params[];

    public void ckeckItSelf() throws IllegalAccessException {
        if (beanName == null || methodName == null) {
            throw new IllegalAccessException("beanName or methodName must not null");
        }

        if (params != paramsTypes) {
            if (null == params) {
                throw new IllegalAccessException("params must not null");
            }
            if (null == paramsTypes) {
                throw new IllegalAccessException("params types must not null");
            }
            if (paramsTypes.length != params.length) {
                throw new IllegalAccessException("param's length must equals paramType's length");
            }
        }
    }

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String[] getParamsTypes() {
        return paramsTypes;
    }

    public void setParamsTypes(String[] paramsTypes) {
        this.paramsTypes = paramsTypes;
    }

    public String[] getParams() {
        return params;
    }

    public void setParams(String[] params) {
        this.params = params;
    }

    @Override
    public String toString() {
        return "InvokerVo{" +
                "beanName='" + beanName + '\'' +
                ", methodName='" + methodName + '\'' +
                ", paramsTypes=" + Arrays.toString(paramsTypes) +
                ", params=" + Arrays.toString(params) +
                '}';
    }
}
